package com.boss.salary.service;

import com.boss.common.entity.PageDTO;
import com.boss.framework.dto.PaginationDTO;
import com.boss.framework.exception.AppRuntimeException;
import com.boss.salary.entity.*;
import com.boss.salary.vo.AgencySalaryVO;
import com.boss.salary.vo.AgencyVerifyParamVo;
import com.boss.sys.ca.user.dto.UserDTO;
import com.singularsys.jep.JepException;

import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.Map;

public interface IAgencySalaryMultipleService {

    /**
     * 分页查询 工资项与机构挂接表数据
     * @param paginationDTO
     * @return
     * @throws AppRuntimeException
     */
    PageDTO<AgencySalary> queryAgencySalaryPage(PaginationDTO paginationDTO) throws AppRuntimeException;

    /**
     * 增加 工资项与机构挂接表数据
     * @param agencyInfoList
     * @param salaryBasedataList
     * @param flag
     * @return
     */
    void saveAgencySalary(List<Map<String, Object>> agencyInfoList, List<Map<String, Object>> salaryBasedataList, String flag, String province) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, JepException;

    /**
     * 更新 工资项与机构挂接表数据
     * @param agencySalary
     * @return
     */
    void updateAgencySalary(AgencySalary agencySalary);

    /**
     * 根据id删除工资项与机构挂接表数据
     * @param id
     * @return
     */
    void deleteAgencySalary(String id);

    /**
     * 根据条件查询 单位与工资项挂接数据
     * @param queryParam
     * @return
     */
    List<AgencySalary> queryAgencySalaryInfo(Map<String, Object> queryParam);

    /**
     * 分页查询 单位工资编报数据
     * @param paginationDTO
     * @param agencyId
     * @return
     * @throws AppRuntimeException
     */
    PageDTO<Map<String,Object>> getUnitSalaryReportPage(PaginationDTO paginationDTO
            , String agencyId, String flag, Map<String,Object> condition,String mofDivCode) throws AppRuntimeException;

  /**
     * 查询工资变动人数
     * @param agencyId
     * @param queryParam
     * @return
     */
    int selectSalaryChangePersonNum(UserDTO userDTO,String agencyId,String isThirtenn, Map<String, Object> queryParam,int is_submit);

    /**
     * 分页查询 单位工资编报数据
     * @param paginationDTO
     * @param agencyId
     * @return
     * @throws AppRuntimeException
     */
    PageDTO<Map<String,Object>> getUnitAuditPage(PaginationDTO paginationDTO
            , String agencyId, String flag, Map<String,Object> condition,UserDTO userDTO,String menuid) throws AppRuntimeException;

    /**
     * 分页查询 单位工资上报数据
     * @param paginationDTO
     * @param queryParam
     * @return
     * @throws AppRuntimeException
     */
    PageDTO<Map<String,Object>> getUnitSalarySubmitReportPage(UserDTO userDTO, PaginationDTO paginationDTO, Map<String, Object> queryParam) throws AppRuntimeException;

    /**
     * 获取上报工资总和
     * @param queryParam
     * @return
     */
    String selectSubmitSalarySum(UserDTO userDTO, Map<String, Object> queryParam) throws AppRuntimeException;

    /**
     * 动态查询工资编报表头
     * @param agencyId
     * @return
     */
    List<String> getColumnName(String agencyId,Map<String,Object> condition,UserDTO userDTO);


    /**
     * 动态查询工资编报表头
     * @param mof_div_code
     * @return
     */
    List<Map<String,Object>> getSalaryName(String mof_div_code);

    /**
     * 编报
     * @param data
     */
    void saveUnitSalaryReport(List<SalaryMonthEnd> data,UserDTO userDto ) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException;

    /**
     * 撤销修改
     * @param
     */
    void rejectEditUnitSalaryReport(String province,SalaryMonthEnd data) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException;

    /**
     * 送审 工资编报
     * @param agencyVerifyParamVo
     */
    void submitUnitSalaryReport(AgencyVerifyParamVo agencyVerifyParamVo, UserDTO userDto);
    /**
     * 送审 工资编报(一岗送财政)
     * @param agencyVerifyParamVo
     */
    void submitUnitSalaryReportOne(AgencyVerifyParamVo agencyVerifyParamVo, UserDTO userDto)  throws Exception;

    /**
     * 撤销送审 工资编报
     * @param agencyVerifyParamVo
     */
    void rejectSubmitUnitSalaryReport(AgencyVerifyParamVo agencyVerifyParamVo, UserDTO userDto);
  /**
   * 撤销送审 工资编报(一岗送财政撤销)
   * @param agencyVerifyParamVo
   */
  void rejectSubmitUnitSalaryReportOne(AgencyVerifyParamVo agencyVerifyParamVo, UserDTO userDto);

    /**
     * 审核 工资编报
     * @param agencyVerifyParamVo
     */
    void auditUnitAudit(AgencyVerifyParamVo agencyVerifyParamVo, UserDTO userDto) throws Exception;

    Map<String,Object> auditUnitAuditInCommit(List<String> agencyids,AgencyVerifyParamVo agencyVerifyParamVo, UserDTO userDto,boolean is_one,String tokenid);
    /**
    *  审核 工资审核单位中间岗
    * @param agencyVerifyParamVo
    */
    void auditUnitAuditMiddle(AgencyVerifyParamVo agencyVerifyParamVo, UserDTO userDto);
    /**
     * 撤销审核 工资编报
     * @param
     */
    void rejectAuditUnitAudit(AgencyVerifyParamVo agencyVerifyParamVo, UserDTO userDto) throws AppRuntimeException;

  /**
   * 撤销审核 工资编报单位中间岗
   * @param
   */
  void rejectAuditUnitAuditMiddle(AgencyVerifyParamVo agencyVerifyParamVo, UserDTO userDto) throws AppRuntimeException;


  /**
     * 退回 工资编报
     * @param
     */
    void returnedUnitAudit(AgencyVerifyParamVo agencyVerifyParamVo, UserDTO userDto);

    /**
     * 撤销退回 工资编报
     * @param agencyId
     */
    void rejectReturnedUnitAudit(String agencyId,UserDTO userDto);

    /**
     * 获取工资编报退回状态
     * @param agencyId
     * @return
     */
    boolean getReturnedState(String agencyId);

    /**
     *获取实发工资总和和机构总人数
     */
    Map<String, String> getReallySendSalarySumAndPersonTotal(String agencyId, String isThirteen, String salaryType);


    /**
     *获取上报实发工资总和和机构总人数
     */
    Map<String, String> querySubmitReallySendSalarySumAndPersonTotal(String agencyId, String isThirteen,Integer queryThirteen, String salaryType);

    /**
     * 档案查询--获取单位下人员的工资信息
     * @param agencyId
     * @param personId
     * @return
     */
    List<Map<String, Object>> getPersonSalaryInfo(String agencyId, String personId,List<String> personTypes,String mof_div_code);

    /**
     * 十三月工资：动态表头
     * @param userDTO
     * @return
     */
    List<AgencySalaryVO> getColumnByAgencyId(UserDTO userDTO);

    /**
     * 倒出查詢表头
     * @param userDTO
     * @return
     */
    List<AgencySalaryVO> getExccelColumnName(UserDTO userDTO);


    /**
     * 导出查询数据
     * @param agencyId
     * @param flag
     * @param condition
     * @return
     * @throws AppRuntimeException
     */
    List<Map<String, Object>> getUnitSalaryReport(UserDTO userDTO,String agencyId, String flag, Map<String,Object> condition)
            throws AppRuntimeException;

    /**
     * 获取单位编报审核状态
     * @param agencyId
     * @param columnNames
     * @return
     */
    Map<String,Object> getSalaryState(String agencyId, String... columnNames);

    /**
     * 单位工资编报：验证是否存在未上传附件人员
     * @param agencyId
     * @return
     */
    boolean verfityExistNoFilePerson(String agencyId);

    /**
     * 分页查询 单位上报数据
     * @param paginationDTO
     * @param agencyId
     * @return
     * @throws AppRuntimeException
     */
    PageDTO<Map<String,Object>> getFinancialAuditSalaryPage(PaginationDTO paginationDTO
            , String agencyId, String flag, Map<String,Object> condition,String mofDivCode) throws AppRuntimeException;




    /**
     * 通过单位ID查询PersonExt表银行信息
     * @param angencyId
     */
    List<PersonExt> selectPersonExtByAgencyId(String angencyId);

    /**
     * 通过单位ID查询AgencyExt表的银行信息
     * @param angencyId
     */
    AgencyExt selectAgencyExtByAgencyId(String angencyId);


  List<Map<String, Object>> getSalaryMonthEedSubmit(String agencyId, String personId, List<String> personTypes, String mof_div_code);

    Integer getSubmitAble(String agencyId);

  List<String> getIsThirteen(String agencyId);

  void addBatch(String agencyId, UserDTO userDto)throws Exception;
  /**
   * 根据单位id获取审核信息
   * @param agencyId
   * @return
   */
  AgencyVerify getAgencyVerifyByAgencyId(String agencyId);
  /**
   * 查询机构名称及其工资编报送审状态和审核状态
   * @param agencyId
   * @return
   */
  Map<String, Object> getAgencyNameAndState(String agencyId);

    void deletedDouble(String agencyId);

    AgencyVerify getAgencyVerifyBizKey(String agencyId);

    Integer getPaidWagesCount(String agencyId, UserDTO userDTO);
}
